package com.fourthDay;

import java.util.ArrayList;

public class StudentUtil {

    private StudentUtil() {

    }

    public static int getMaxAgeStudent(ArrayList<CheckStudent> list) {
        // 1. 定义一个参照物
        Integer age = list.get(0).getAge();

        for (CheckStudent checkStudent : list) {
            if (age < checkStudent.getAge()) {
                age = checkStudent.getAge();
            }
        }

        return age;
    }
}
